package com.teamclub.app.scontrollers.clientmanager

import com.teamclub.app.sforms.AppClientVersionForm
import com.teamclub.app.sservices.clientmanager.AppClientVersionService
import com.teamclub.util.libs.Eithers
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.{PostMapping, RequestBody, RequestMapping, RestController}

@RestController("com.teamclub.app.scontrollers.clientmanager.AppClientVersionController")
@RequestMapping(Array("/app/appclientversion"))
class AppClientVersionController {
  @Autowired
  var service: AppClientVersionService = _

  @PostMapping(Array("getnewestversion"))
  def getNewestVersion(@RequestBody form: AppClientVersionForm) = {
    Eithers.toJson(service.getNewestVersion(form))
  }

}
